Hacking with Spring Boot 2.4: Classic Edition by Greg L. Turnquist

Hacking with Spring Boot 2.4: Classic Edition by Greg L. Turnquist

Author:Greg L. Turnquist
Language: eng
Format: epub, pdf
Tags: spring boot, spring boot 2, spring boot 2.4, spring, spring framework
Published: 2021-03-03T20:13:06+00:00


Managing your application in production

You finished Day 1 by deploying your application to production. Now it’s time for Day 2, managing your application.

The rest of this chapter will show the various tools provided by Spring Boot’s Actuator module to help monitor your application.

Pinging your app with Spring Boot Actuator and /actuator/health

So you’ve built a Spring Boot application. You crafted some web pages and render them using WebFlux. You stirred in a little Spring Data. Spring Boot’s developer tools sure did speed up the cycles to get that hammered out.

And five minutes ago…​you pushed that runnable JAR file to the server (or perhaps installed from a thumb drive in your air-gapped server room).

So now what?

The first question from the Ops team now managing your app will probably be, "can we ping it?" And they’re just getting warmed up. What about metrics? Stats? Detailed health checks? Does it plays nicely with the database they also have to manage?

You could start to craft some extra controllers to meet these requests.

Or…​you could add Spring Boot Actuator and call it a day.

To add operational support to your Spring Boot app, add this to your build file.

Adding Spring Boot Actuator to the build

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.